using System;
using FluentNHibernate.Conventions;
using FluentNHibernate.Conventions.Instances;

namespace Caramel.FluentNHibernate.Conventions
{
    public class HasManyToManyTableNamingConvention : IHasManyToManyConvention
    {
        #region IConvention<IManyToManyCollectionInspector,IManyToManyCollectionInstance> Members

        public void Apply(IManyToManyCollectionInstance instance)
        {
            instance.Table(instance.EntityType.Name + "_" + instance.ChildType.Name);
        }

        #endregion
    }
}
